<template>
	<view>
		
		<view class="user-center">
			<button type="default" class="change" @tap="change">修改用户信息</button>
			<view class="item">
				<view class="text">
					头像
				</view>
				<view class="desc">
					
				</view>
			</view>
			<view class="item">
				<view class="text">
					用户名
				</view>
				<view class="desc">
					{{userObj.username}}
				</view>
			</view>
			<view class="item">
				<view class="text">
					昵称
				</view>
				<view class="desc">
					{{userObj.nickname}}
				</view>
			</view>
			
			<view class="item">
				<view class="text">
					手机号
				</view>
				<view class="desc">
					{{userObj.phone}}
				</view>
			</view>
				<button type="default" class="leave" @tap="leave">退出登陆</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userObj:{}
			}
		},
		methods: {
			leave(){
				uni.navigateTo({
					url:'/pages/login/login'
				})
				uni.removeStorageSync('token')
				uni.removeStorageSync("userList")
			},
			change(){
				uni.navigateTo({
					url:"/pages/mine/changeUser/changeUser"
				})
			}
		},
		onShow(){
			this.userObj=uni.getStorageSync("userList")
			console.log(this.userObj)
		}
	}
</script>

<style scoped lang="scss">
 .change{
	 float: right;
	 margin-top: 20rpx;
	 color: #353535;
	 border: 2rpx solid #353535;
	 background-color: rgba(0,0,0,0);
	 width: 224rpx;
	 height: 60rpx;
	 font-size: 26rpx;
	 line-height: 60rpx;
 }
 .user-center{
	 width: 90%;
	 margin: 0 auto;
	 .item{
		 width: 100%;
		 display: flex;
		 justify-content: space-between;
		 align-items: center;
		 font-size: 32rpx;
		 line-height: 94rpx;
		 box-sizing: border-box;
		 padding: 10rpx 30rpx;
		 border-bottom: 2rpx solid #e5e5e5;
		 .text{
			 color: #494949;
		 }
	 }
	 .leave{
			position: fixed;
		     left: 50%;
		     bottom: 20%;
		     margin-left: -184rpx;
		     width: 370rpx;
		     height: 88rpx;
		     font-size: 32rpx;
		     color: #fff;
		     text-align: center;
		     line-height: 88rpx;
		     background: #1c4b47;
		     border-radius: 16rpx;
	 }
 }
</style>
